package com.java.controller.front;

import com.java.service.PlayerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;

@Controller
@RequestMapping("/front")
public class PlayerController {
    @Autowired
    private PlayerService playerService;

    /**
     * 参赛选手注册，插入数据
     */
    @RequestMapping("/addPlayers")
    public String setPlayer(@RequestParam Map<String,Object> map){
        int result = playerService.addPlayer(map);
        if(result==1){
            return "front/success.jsp";
        }else {
            return "error/error.jsp";
        }
    }

}
